package com.dk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dk.mapper.TbFeedbackMapper;
import com.dk.pojo.TbFeedback;
import com.dk.service.TbFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbFeedbackServiceImpl implements TbFeedbackService {

    @Autowired
    private TbFeedbackMapper feedbackMapper;

    @Override
    public List<TbFeedback> selectAll() {
        QueryWrapper<TbFeedback> wrapper = new QueryWrapper<>();
        wrapper.notIn("status","1");
        return feedbackMapper.selectList(wrapper);
    }

    @Override
    public TbFeedback getFeedbackById(Long id) {
        return feedbackMapper.selectById(id);
    }

    @Override
    public void updateStatusById(TbFeedback feedback) {
        feedback.setStatus("1");
        feedbackMapper.updateById(feedback);
    }
}
